package org.example.springboot.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsKey;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.example.springboot.common.entity.BaseEntity;

import java.util.Date;

/**
 * 设备信息
 *
 * @author Fz
 * @since 1.0.0 2024-02-26
 */
@EqualsAndHashCode(callSuper = false)
@Data
@TableName("col_device")
public class ColDevice {

    @IsKey
    @TableId(value = "id", type = IdType.AUTO)
    private String id;

    @Column(name = "no", comment = "设备编号", type = MySqlTypeConstant.VARCHAR, length = 100)
    private String no;

    /**
     * 工程名称
     */
    @Column(name = "pro_name", comment = "工程名称", type = MySqlTypeConstant.VARCHAR, length = 100)
    private String proName;

    /**
     * 灌溉日期
     */
    @Column(name = "area_id", comment = "所在地")
    private Long areaId;

    /**
     * 软件版本
     */
    @Column(name = "soft_version", comment = "软件版本", type = MySqlTypeConstant.VARCHAR, length = 200)
    private String softVersion;

    /**
     * 硬件版本
     */
    @Column(name = "hard_version", comment = "硬件版本", type = MySqlTypeConstant.VARCHAR, length = 200)
    private String hardVersion;

    /**
     * SIM卡号
     */
    @Column(name = "sim_no", comment = "SIM卡号", type = MySqlTypeConstant.VARCHAR, length = 200)
    private String simNo;

    /**
     * SIM到期日期
     */
    @Column(name = "sim_date", comment = "SIM卡号", type = MySqlTypeConstant.DATE)
    private Date simDate;

    /**
     * 经度
     */
    @Column(name = "longitude", comment = "经度", type = MySqlTypeConstant.VARCHAR, length = 200)
    private String longitude;

    /**
     * 纬度
     */
    @Column(name = "latitude", comment = "纬度", type = MySqlTypeConstant.VARCHAR, length = 200)
    private String latitude;

    /**
     * 设备类型   1：采集设备    2：控制设备
     */
    @Column(name = "dev_type", comment = "设备类型   1：采集设备    2：控制设备", type = MySqlTypeConstant.TINYINT)
    private Integer devType;

    /**
     * 备注
     */
    @Column(name = "remark", comment = "备注", type = MySqlTypeConstant.VARCHAR, length = 500)
    private String remark;

    /**
     * 租户编码
     */
    @Column(name = "tenant_code", comment = "租户编码")
    private Long tenantCode;

    /**
     * 创建者
     */
    @Column(name = "creator", comment = "创建者")
    private Long creator;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @Column(name = "create_date", comment = "创建时间", type = MySqlTypeConstant.DATETIME, length = 100)
    private Date createDate;

    /**
     * 修改者
     */
    @Column(name = "updater", comment = "修改者")
    private Long updater;

    /**
     * 最后更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Column(name = "update_date", comment = "更新时间", type = MySqlTypeConstant.DATETIME, length = 36)
    private Date updateDate;

    /**
     * 删除标志 0 正常 1 已删除
     */
    @Column(name = "del_flag", comment = "删除标志 0 正常 1 已删除", length = 2, type = MySqlTypeConstant.TINYINT)
    private Integer delFlag;

    /**
     * 删除者
     */
    @Column(name = "deleter", comment = "删除者")
    private Long deleter;

    /**
     * 删除时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    @Column(name = "delete_date", type = MySqlTypeConstant.DATETIME, comment = "删除时间")
    private Date deleteDate;

    /**
     * 删除时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    @Column(name = "frequency_time", type = MySqlTypeConstant.DATETIME, comment = "最新配置时间")
    private Date frequencyTime;

}